﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Text;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Collections.ObjectModel;

namespace PatriotCreations.JpegData
{
    public class IptcReader : ImageReader
    {
        /// <summary>
        /// Constructor that Takes an ImageSource
        /// </summary>
        /// <param name="imageSource">A valid stream that represents a jpeg image.</param>
        public IptcReader(Stream imageSource) : base(imageSource)
        {
        }

        #region Common Values Overridden

        public override string City
        {
            get { return this.Meta.GetQuery("/app13/irb/8bimiptc/iptc/City").ToString(); }
        }

        public override string State
        {
            get { return this.Meta.GetQuery("/app13/irb/8bimiptc/iptc/Province\\/State").ToString(); }
        }

        public override string Country
        {
            get { return this.Meta.GetQuery("/app13/irb/8bimiptc/iptc/Country\\/Primary Location Name").ToString(); }
        }

        public override string Category
        {
            get { return this.Meta.GetQuery("/app13/irb/8bimiptc/iptc/Category").ToString(); }
        }

        public override string[] SubCategories
        {
            get { return (string[])this.Meta.GetQuery("/app13/irb/8bimiptc/iptc/Supplemental Category"); }
        }

        public override string AuthorsPosition
        {
            get { return this.Meta.GetQuery("/app13/irb/8bimiptc/iptc/By-line Title").ToString(); }
        }

        public override string Credit
        {
            get { return this.Meta.GetQuery("/app13/irb/8bimiptc/iptc/Credit").ToString(); }
        }

        public override string Urgency
        {
            get { return this.Meta.GetQuery("/app13/irb/8bimiptc/iptc/Urgency").ToString(); }
        }

        public override string DateCreated
        {
            get { return this.Meta.GetQuery("/app13/irb/8bimiptc/iptc/Date Created").ToString(); }
        }

        public override string ImageLocation
        {
            get { return this.Meta.GetQuery("/app13/irb/8bimiptc/iptc/Sub-location").ToString(); }
        }

        public override string Creator
        {
            get { return this.Meta.GetQuery("/app13/irb/8bimiptc/iptc/Credit").ToString(); }
        }

        public override string CopyrightNotice
        {
            get { return this.Meta.GetQuery("/app13/irb/8bimiptc/iptc/Copyright Notice").ToString(); }
        }

        #endregion
    }
}
